import React, { Component } from 'react';
import { connect } from 'dva';
import { Card, Badge, Table, Divider } from 'antd';
import DescriptionList from '@/components/DescriptionList';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './Detail.less';
import article from "../../models/article";
const { Description } = DescriptionList;
export default
@connect(({ opration, loading }) => ({
  opration,
  loading: loading.effects['opration/detail'],
}))
class Detail extends Component {
  componentDidMount() {
    const articleID=this.props.match.params.id;
    const { dispatch } = this.props;
    dispatch({
      type: 'opration/detail',
      payload:articleID
    });
  }

  render() {
    const { opration:{detail}, loading } = this.props;
    function createMarkup(str) { return {__html: str}; };
    return (
      <PageHeaderWrapper title="文章详情">
        <Card bordered={false}>
          <DescriptionList size="large" title="广告类型" style={{ marginBottom: 32 }}>
            <Description>{detail.category}</Description>
          </DescriptionList>
          <DescriptionList size="large" title="标题" style={{ marginBottom: 32 }}>
            <Description>{detail.name}</Description>
          </DescriptionList>
          <DescriptionList size="large" title="url链接" style={{ marginBottom: 32 }}>
            <Description>{detail.url}</Description>
          </DescriptionList>
          <DescriptionList size="large" title="封面图" style={{ marginBottom: 32 }}>
            <img src={detail.pic} alt=""/>
          </DescriptionList>
        </Card>
      </PageHeaderWrapper>
    );
  }
}
